//
//  IGImageToken.m
//  jingdongfang
//
//  Created by BOE on 2017/9/12.
//  Copyright © 2017年 LJL. All rights reserved.
//

#import "IGImageToken.h"

@implementation IGImageToken

+ (JSONKeyMapper *)keyMapper
{
    return [[JSONKeyMapper alloc]
            initWithModelToJSONDictionary:@{
                                            @"accessKeyId":@"AccessKeyId",
                                            @"accessKeySecret":@"AccessKeySecret",
                                            @"securityToken":@"SecurityToken",
                                            @"expiration":@"Expiration",
                                            @"bucketPoint":@"cdn"
                                            }];
}

+ (BOOL)propertyIsOptional:(NSString *)propertyName {
    return YES;
}


- (void)configBucketPath:(IGAliYunFolderType)type {
    NSArray *folders = @[@"banner", @"circle", @"product", @"special", @"user", @"sys", @"privateMsg",@"refund",@"drawList"];
    if (type <= folders.count) {
        self.bucketPath = folders[type - 1];
    } else {
        [self presentMessageTips:@"文件夹配置错误"];
    }
}

@end

@implementation IGImageTokenApi : IGBaseRequest

- (NSString *)requestUrl {
    return @"oss/genertateSTS.action";
}

- (id)requestArgument {
    return @{
             @"uId":[IGUser getUid]
             };
}

@end

@implementation IGImageTokenModel : IGBaseModel

@end

@implementation IGImageTokenResp : IGBaseResp

@end
